//
//  XYBusinessRecordSelectVC.m
//  Zhihuijinfu
//
//  Created by XY Lv on 17/3/22.
//  Copyright © 2017年 王笛. All rights reserved.
//

#import "XYBusinessRecordSelectVC.h"
#import "XYCallBackVC.h"
@interface XYBusinessRecordSelectVC ()<UITableViewDelegate,UITableViewDataSource>
{
    UITableView * _xyTableView;
    NSArray *     _xyIconArr;
    NSArray *     _xyTitleArr;

}
@end

@implementation XYBusinessRecordSelectVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self xyInitData];
    [self loadNavItemWithLeftAction:@selector(clickNavLeftBtn) leftBtnImage:@"icon_back" leftBtnSelImage:@"icon_back" title:@"跟进记录选择" rihgtAction:@selector(clickNavRightBtn) rightBtnImage:nil rightBtnSelImage:nil];
    [self xyLayoutTableView];
}

- (void)xyInitData{
    _xyIconArr = @[@"xy_icon_phone",@"xy_icon_face"];
    _xyTitleArr = @[@"电话回访",@"面访签到"];
}

- (void)xyLayoutTableView{
    _xyTableView = [[UITableView alloc]init];
    [self.view addSubview:_xyTableView];
    [_xyTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.width.mas_equalTo(self.view);
        make.top.mas_equalTo(self.view).offset(64);
        make.height.mas_equalTo(self.view.bounds.size.height - 64);
    }];
    _xyTableView.dataSource = self;
    _xyTableView.delegate  = self;
    _xyTableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero];
}

//代理
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell * cell= [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cellId"];
    [cell.imageView setImage:[UIImage imageNamed:[_xyIconArr objectAtIndex:indexPath.row]]];
    cell.textLabel.text = _xyTitleArr[indexPath.row];
    cell.textLabel.textColor = [UIColor colorWithRed:0.46 green:0.46 blue:0.47 alpha:1.00];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return xy(50);
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"选择:%ld",indexPath.row);
    XYCallBackVC * callVC = [[XYCallBackVC alloc]init];
    callVC.xyFollowType = [NSString stringWithFormat:@"%ld",indexPath.row+1];
    callVC.business = self.business;
    [self.navigationController pushViewController:callVC animated:YES];
}

//点击事件
- (void)clickNavLeftBtn{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)clickNavRightBtn{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end







